package way.scripts.classDoc.segment;

import org.apache.commons.lang3.tuple.Triple;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Haozhiqiang  {2021/12/7 14:00}
 */
public class ClassList extends AbstractNode {

    private static final String name = "类列表";
    private static final String[] columns = {"类名称","定义","描述"};

    private String className;
    private List<Triple<String, String, String>> contents;
    private final List<CDClass> cdClassList = new ArrayList<>();

    @Override
    public int getLevel() {
        return 2;
    }

    public static String getName() {
        return name;
    }

    public static String[] getColumns() {
        return columns;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public List<Triple<String, String, String>> getContents() {
        return contents;
    }

    public void setContents(List<Triple<String, String, String>> contents) {
        this.contents = contents;
    }

    public List<CDClass> addCdClassList() {
        return cdClassList;
    }

    public void setCdClassList(CDClass cdClass) {
        cdClass.setParentIndex(getDocIndex());
        cdClass.setSelfIndex(cdClassList.size() + 1);
        this.cdClassList.add(cdClass);
    }


}
